

package com.hazelcast.jet.impl.operation;

import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;
import com.hazelcast.spi.impl.operationservice.UrgentSystemOperation;

import java.util.concurrent.CompletableFuture;

/**
 * Sent from the member that initiates a cluster state change to the master.
 * When the operation completes, all jobs have been terminated.
 */
public class PrepareForPassiveClusterOperation extends AsyncOperation implements UrgentSystemOperation {

    public PrepareForPassiveClusterOperation() {
    }

    @Override
    protected CompletableFuture<Void> doRun() {
        return getJobCoordinationService().prepareForPassiveClusterState();
    }

    @Override
    public int getClassId() {
        return JetInitDataSerializerHook.PREPARE_FOR_PASSIVE_CLUSTER_OP;
    }
}
